package jobflow.scheduleBean;

import java.io.File;
import java.util.Date;

import jobflow.entity.Departman;

import org.apache.log.output.io.rotate.FileStrategy;
import org.hsqldb.lib.FileUtil;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.async.Asynchronous;
import org.jboss.seam.annotations.async.Expiration;
import org.jboss.seam.annotations.async.FinalExpiration;
import org.jboss.seam.annotations.async.IntervalDuration;
import org.jfree.io.FileUtilities;

@Name("scheduleBean")
@AutoCreate
@Scope(ScopeType.STATELESS)
public class ScheduleBean {
	
	@In(required=false,create=true) Departman currentRow;

	@Asynchronous
	public void imageDelete(@Expiration Date when,@IntervalDuration Long interval, @FinalExpiration Date stoptime)
			
	{
     
	
		
		File file = new File("E:/worspaceler/seam_calisma/seam_calisma/jobflow/WebContent/images/departman");
	      
	      
	      File[] files =file.listFiles();
	      for (File deleteFile : files) {
	    	  
	    	   deleteFile.delete();
			
		   }
		
		System.out.println("calisiyorrrrr");
		
	
	}

}
